Index: applications/order/widget/ordermgr/OrderViewScreens.xml =================================================================== --- applications/order/widget/ordermgr/OrderViewScreens.xml (revision 1125571) +++ applications/order/widget/ordermgr/OrderViewScreens.xml (working copy) @@ -93,6 +93,7 @@ + @@ -176,6 +177,15 @@ + +
+ + + + + +
+
Index: applications/order/config/OrderUiLabels.xml =================================================================== --- applications/order/config/OrderUiLabels.xml (revision 1125571) +++ applications/order/config/OrderUiLabels.xml (working copy) @@ -10064,6 +10064,10 @@ 销售订单查找失败 銷售訂單查詢失敗 + + Sales Reps + Venditori + DPH Mehrwertsteuer Index: applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java =================================================================== --- applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (revision 1125571) +++ applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (working copy) @@ -3233,7 +3233,7 @@ Iterator cartItemIter = this.iterator(); while (cartItemIter.hasNext()) { ShoppingCartItem checkItem = cartItemIter.next(); - if (checkItem.getIsPromo()) { + if (checkItem != null && checkItem.getIsPromo()) { this.clearItemShipInfo(checkItem); cartItemIter.remove(); } else { Index: applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java =================================================================== --- applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java (revision 1125571) +++ applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java (working copy) @@ -230,8 +230,8 @@ } // add or increase the item to the cart + int itemId = -1; try { - int itemId = -1; if (productId != null) { itemId = cart.addOrIncreaseItem(productId, amount, quantity, reservStart, reservLength, @@ -263,6 +263,9 @@ // Indicate there were no critical errors result = ServiceUtil.returnSuccess(); + if (itemId != -1) { + result.put("itemId", new Integer(itemId)); + } return result; } Index: applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java =================================================================== --- applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (revision 1125571) +++ applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (working copy) @@ -584,6 +584,11 @@ shipBeforeDate, shipAfterDate, configWrapper, itemGroupNumber, paramMap, parentProductId); controlDirective = processResult(result, request); + Integer itemId = (Integer)result.get("itemId"); + if (UtilValidate.isNotEmpty(itemId)) { + request.setAttribute("itemId", itemId); + } + // Determine where to send the browser if (controlDirective.equals(ERROR)) { return "error"; Index: applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy =================================================================== --- applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy (revision 1125571) +++ applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy (working copy) @@ -81,6 +81,9 @@ context.currencyUomId = orderReadHelper.getCurrency(); context.orderTerms = orderTerms; + // get sales reps + context.salesReps = orderHeader.getRelated("OrderRole", [orderId : orderHeader.orderId, roleTypeId : "SALES_REP"], null); + // get the order type orderType = orderHeader.orderTypeId; context.orderType = orderType; Index: framework/base/src/org/ofbiz/base/util/UtilNumber.java =================================================================== --- framework/base/src/org/ofbiz/base/util/UtilNumber.java (revision 1125571) +++ framework/base/src/org/ofbiz/base/util/UtilNumber.java (working copy) @@ -20,6 +20,8 @@ package org.ofbiz.base.util; import java.math.BigDecimal; +import java.text.NumberFormat; +import java.text.ParseException; import java.util.HashMap; import java.util.Locale; @@ -250,4 +252,27 @@ return (bd.toString() + "%"); } + + /** + * Method to convert a string into BigDecimal. + * + * @param stringToConvert String to convert to BigDecimal + * @return The string converted to BigDecimal + */ + public static BigDecimal stringToBigDecimal(String stringToConvert, Locale locale) { + if (stringToConvert != null && stringToConvert != "") { + Number numb = null; + NumberFormat nf = NumberFormat.getInstance(locale); + nf.setMaximumFractionDigits(10); + try { + numb = nf.parse(stringToConvert); + return (new BigDecimal(numb.toString())); + } catch (ParseException e) { + return null; + } + } + else { + return null; + } + } } Index: specialpurpose/webpos/servicedef/services_payment.xml =================================================================== --- specialpurpose/webpos/servicedef/services_payment.xml (revision 1096554) +++ specialpurpose/webpos/servicedef/services_payment.xml (working copy) @@ -21,55 +21,50 @@ Web Pos Payment Services OFBiz 1.0 - + Pay Cash - + - + Pay Check - + - + Pay Gift Card - + - - + + Pay Credit Card - + + + + - - - + + + - - + + - - - Process Sale + + + Pay Finish - - - Set Payment Refernce Number - - - - - + Clear Payment @@ -78,7 +73,7 @@ - + Clear All Payments Index: specialpurpose/webpos/servicedef/services.xml =================================================================== --- specialpurpose/webpos/servicedef/services.xml (revision 1096554) +++ specialpurpose/webpos/servicedef/services.xml (working copy) @@ -22,23 +22,6 @@ OFBiz 1.0 - - Find products by name/description - - - - - - - - Find products by good identification - - - - - Login for Web Pos Index: specialpurpose/webpos/servicedef/services_customer.xml =================================================================== --- specialpurpose/webpos/servicedef/services_customer.xml (revision 0) +++ specialpurpose/webpos/servicedef/services_customer.xml (revision 0) @@ -0,0 +1,40 @@ + + + + Web Pos Customer Services + OFBiz + 1.0 + + + Create/update party address + + + + + + + + + + + + + Index: specialpurpose/webpos/servicedef/services_search.xml =================================================================== --- specialpurpose/webpos/servicedef/services_search.xml (revision 0) +++ specialpurpose/webpos/servicedef/services_search.xml (revision 0) @@ -0,0 +1,46 @@ + + + + Web Pos Search Services + OFBiz + 1.0 + + + Find products by name/description/good identification value + + + + + + + + + Find parties by name/surname/good identification value + + + + + + + + + Index: specialpurpose/webpos/servicedef/services_cart.xml =================================================================== --- specialpurpose/webpos/servicedef/services_cart.xml (revision 0) +++ specialpurpose/webpos/servicedef/services_cart.xml (revision 0) @@ -0,0 +1,93 @@ + + + + Web Pos Cart Services + OFBiz + 1.0 + + + Set party to cart + + + + + + + Update Cart Item + + + + + + Delete Cart Item + + + + + Get Product And Price + + + + + + + + Get Formatted Amount + + + + + + + Get Formatted Feature Price + + + + + + + + Remove Sales Rep from cart + + + + + Add Sales Rep to cart + + + + + Get ship methods + + + + Set ship method + + \ No newline at end of file Index: specialpurpose/webpos/servicedef/services_manager.xml =================================================================== --- specialpurpose/webpos/servicedef/services_manager.xml (revision 1096554) +++ specialpurpose/webpos/servicedef/services_manager.xml (working copy) @@ -21,47 +21,48 @@ Web Pos Manager Services OFBiz 1.0 - + Open Terminal - + - + Close Terminal - - - - - + + + + + - + Void Order - + Shutdown - + Paid Out and In - - + + + - + Modify Price - - + + Index: specialpurpose/webpos/servicedef/services_promo.xml =================================================================== --- specialpurpose/webpos/servicedef/services_promo.xml (revision 1096554) +++ specialpurpose/webpos/servicedef/services_promo.xml (working copy) @@ -21,7 +21,7 @@ Web Pos Promotions Services OFBiz 1.0 - + Add Promotion Code Index: specialpurpose/webpos/widget/PaymentScreens.xml =================================================================== --- specialpurpose/webpos/widget/PaymentScreens.xml (revision 1096554) +++ specialpurpose/webpos/widget/PaymentScreens.xml (working copy) @@ -20,96 +20,56 @@ - +
- - - +
- +
- - - - - + + +
- +
- - - +
- +
- - - +
- - -
- - - - + + + \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/cart/MicroCart.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/cart/MicroCart.ftl (revision 1096554) +++ specialpurpose/webpos/webapp/webpos/cart/MicroCart.ftl (working copy) @@ -1,57 +0,0 @@ -<#-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> -
- <#if (shoppingCartSize > 0)> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
${uiLabelMap.WebPosTransactionId}${transactionId?default("NA")}${(paymentCash.get("description", locale))?if_exists}<@ofbizCurrency amount=cashAmount isoCode=shoppingCart.getCurrency()/>${uiLabelMap.OrderSalesTax}<@ofbizCurrency amount=shoppingCart.getTotalSalesTax() isoCode=shoppingCart.getCurrency()/>
${uiLabelMap.WebPosDrawer}${drawerNumber?default(0)}${(paymentCheck.get("description", locale))?if_exists}<@ofbizCurrency amount=checkAmount isoCode=shoppingCart.getCurrency()/>${uiLabelMap.WebPosCartTotal}<@ofbizCurrency amount=shoppingCart.getDisplayGrandTotal() isoCode=shoppingCart.getCurrency()/>
${uiLabelMap.WebPosEmployee}${userLoginId?default("NA")}${(paymentGift.get("description", locale))?if_exists}<@ofbizCurrency amount=giftAmount isoCode=shoppingCart.getCurrency()/> 
${uiLabelMap.WebPosTransactionDate}${transactionDate?default("NA")}${(paymentCredit.get("description", locale))?if_exists}<@ofbizCurrency amount=creditAmount isoCode=shoppingCart.getCurrency()/>${uiLabelMap.WebPosTransactionTotalDue}<@ofbizCurrency amount=totalDue isoCode=shoppingCart.getCurrency()/>
- <#else> -   - -
\ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/cart/ChooseVariant.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/cart/ChooseVariant.ftl (revision 0) +++ specialpurpose/webpos/webapp/webpos/cart/ChooseVariant.ftl (revision 0) @@ -0,0 +1,77 @@ +<#-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/cart/ShowCart.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/cart/ShowCart.ftl (revision 1096554) +++ specialpurpose/webpos/webapp/webpos/cart/ShowCart.ftl (working copy) @@ -16,111 +16,135 @@ specific language governing permissions and limitations under the License. --> + + + +<#if (shoppingCartSize > 0)> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
${uiLabelMap.WebPosTransactionId}${transactionId?default("NA")}${(paymentCash.get("description", locale))?if_exists}<@ofbizCurrency amount=cashAmount isoCode=shoppingCart.getCurrency()/>${uiLabelMap.WebPosTotalItemSubTotal}<@ofbizCurrency amount=shoppingCart.getDisplaySubTotal() isoCode=shoppingCart.getCurrency()/>
${uiLabelMap.WebPosDrawer}${drawerNumber?default(0)}${(paymentCheck.get("description", locale))?if_exists}<@ofbizCurrency amount=checkAmount isoCode=shoppingCart.getCurrency()/>${uiLabelMap.WebPosTotalPromotions}<@ofbizCurrency amount=shoppingCart.getOrderOtherAdjustmentTotal() isoCode=shoppingCart.getCurrency()/>
${uiLabelMap.WebPosTerminal}<#if isOpen>${uiLabelMap.WebPosTerminalOpen}<#else>${uiLabelMap.WebPosTerminalClose}${(paymentGift.get("description", locale))?if_exists}<@ofbizCurrency amount=giftAmount isoCode=shoppingCart.getCurrency()/>${uiLabelMap.WebPosTotalSalesTax}<@ofbizCurrency amount=shoppingCart.getTotalSalesTax() isoCode=shoppingCart.getCurrency()/>
${(paymentCredit.get("description", locale))?if_exists}<@ofbizCurrency amount=creditAmount isoCode=shoppingCart.getCurrency()/>${uiLabelMap.WebPosTotalShipping}<@ofbizCurrency amount=shoppingCart.getTotalShipping() isoCode=shoppingCart.getCurrency()/>
${uiLabelMap.WebPosTransactionTotalDue}<@ofbizCurrency amount=totalDue isoCode=shoppingCart.getCurrency()/>${uiLabelMap.WebPosTransactionTotalPay}<@ofbizCurrency amount=totalPay isoCode=shoppingCart.getCurrency()/>${uiLabelMap.WebPosTotal}<@ofbizCurrency amount=shoppingCart.getDisplayGrandTotal() isoCode=shoppingCart.getCurrency()/>
+
+ +
+ + + + + + + + + + + + <#if (shoppingCartSize > 0)> + + <#-- set initial row color --> + <#assign alt_row = false> + <#list shoppingCart.items() as cartLine> + <#assign cartLineIndex = shoppingCart.getItemIndex(cartLine)> + class="pos-cart-even"<#else>class="pos-cart-odd"> + + + + + + + + <#-- toggle the row color --> + <#assign alt_row = !alt_row> + + + + + + + + + + + + + + + + +
${uiLabelMap.OrderProduct}${uiLabelMap.CommonQuantity}${uiLabelMap.WebPosUnitPrice}${uiLabelMap.WebPosAdjustments}${uiLabelMap.WebPosItemTotal}${uiLabelMap.CommonRemove}
+
+ <#if cartLine.getProductId()?exists> + <#-- product item --> + <#-- start code to display a small image of the product --> + <#if cartLine.getParentProductId()?exists> + <#assign parentProductId = cartLine.getParentProductId()/> + <#else> + <#assign parentProductId = cartLine.getProductId()/> + + <#assign smallImageUrl = Static["org.ofbiz.product.product.ProductContentWrapper"].getProductContentAsText(cartLine.getProduct(), "SMALL_IMAGE_URL", locale, dispatcher)?if_exists> + <#if !smallImageUrl?string?has_content><#assign smallImageUrl = "/images/defaultImage.jpg"> + <#if smallImageUrl?string?has_content> + + + <#-- end code to display a small image of the product --> + ${cartLine.getProductId()} - ${cartLine.getName()?if_exists} : ${cartLine.getDescription()?if_exists} + <#else> + <#-- this is a non-product item --> + ${cartLine.getItemTypeDescription()?if_exists} : ${cartLine.getName()?if_exists} + +
+
+ ${cartLine.getQuantity()?string.number} +
<@ofbizCurrency amount=cartLine.getDisplayPrice() isoCode=shoppingCart.getCurrency()/>
<@ofbizCurrency amount=cartLine.getOtherAdjustments() isoCode=shoppingCart.getCurrency()/>
<@ofbizCurrency amount=cartLine.getDisplayItemSubTotal() isoCode=shoppingCart.getCurrency()/>

${shoppingCartSize?default(0)}${totalQuantity?default(0)}  <@ofbizCurrency amount=shoppingCart.getDisplaySubTotal() isoCode=shoppingCart.getCurrency()/> 
+
-
- - - - - - - - - - - - <#if (shoppingCartSize > 0)> - - - <#assign itemsFromList = false> - <#-- set initial row color --> - <#assign alt_row = false> - <#list shoppingCart.items() as cartLine> - <#assign cartLineIndex = shoppingCart.getItemIndex(cartLine)> - <#-- show adjustment info --> - <#list cartLine.getAdjustments() as cartLineAdjustment> - - - class="alternate-row pos-cart-hover-bar"<#else>class="pos-cart-hover-bar"> - - - - - - - - - - <#-- toggle the row color --> - <#assign alt_row = !alt_row> - - - -
 ${uiLabelMap.OrderProduct} ${uiLabelMap.CommonQuantity}${uiLabelMap.WebPosUnitPrice}${uiLabelMap.WebPosAdjustments}${uiLabelMap.WebPosItemTotal}
  -
- <#if cartLine.getProductId()?exists> - <#-- product item --> - <#-- start code to display a small image of the product --> - <#if cartLine.getParentProductId()?exists> - <#assign parentProductId = cartLine.getParentProductId()/> - <#else> - <#assign parentProductId = cartLine.getProductId()/> - - <#assign smallImageUrl = Static["org.ofbiz.product.product.ProductContentWrapper"].getProductContentAsText(cartLine.getProduct(), "SMALL_IMAGE_URL", locale, dispatcher)?if_exists> - <#if !smallImageUrl?string?has_content><#assign smallImageUrl = "/images/defaultImage.jpg"> - <#if smallImageUrl?string?has_content> - - - <#-- end code to display a small image of the product --> - ${cartLine.getProductId()} - ${cartLine.getName()?if_exists} : ${cartLine.getDescription()?if_exists} - <#else> - <#-- this is a non-product item --> - ${cartLine.getItemTypeDescription()?if_exists} : ${cartLine.getName()?if_exists} - -
-
-   - -
- -
-
<@ofbizCurrency amount=cartLine.getDisplayPrice() isoCode=shoppingCart.getCurrency()/>
<@ofbizCurrency amount=cartLine.getOtherAdjustments() isoCode=shoppingCart.getCurrency()/>
<@ofbizCurrency amount=cartLine.getDisplayItemSubTotal() isoCode=shoppingCart.getCurrency()/>
<#if !cartLine.getIsPromo()><#else> 
-
\ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/error/error.jsp =================================================================== --- specialpurpose/webpos/webapp/webpos/error/error.jsp (revision 1096554) +++ specialpurpose/webpos/webapp/webpos/error/error.jsp (working copy) @@ -16,37 +16,4 @@ specific language governing permissions and limitations under the License. --%> -<%@ page import="org.ofbiz.base.util.*" %> - - -Open For Business Message - - - -<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %> - - -
-
- - - - -
- - - - - - - -
-
:ERROR MESSAGE:
-
-
<%=UtilFormatOut.replaceString(errorMsg, "\n", "
")%>
-
-
-
-
- - +<%response.sendRedirect("control/error");%> \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/Login.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/Login.ftl (revision 1096554) +++ specialpurpose/webpos/webapp/webpos/Login.ftl (working copy) @@ -65,6 +65,8 @@ +
+ ${uiLabelMap.CommonForgotYourPassword}? Index: specialpurpose/webpos/webapp/webpos/promo/PromoCode.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/promo/PromoCode.ftl (revision 1096554) +++ specialpurpose/webpos/webapp/webpos/promo/PromoCode.ftl (working copy) @@ -16,29 +16,26 @@ specific language governing permissions and limitations under the License. --> - -
-
- - - - - - - - - - - - - - -
 
${uiLabelMap.WebPosPromoCode}
 
- - -
-
-
- \ No newline at end of file + \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/shortcuts/Shortcuts.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/shortcuts/Shortcuts.ftl (revision 0) +++ specialpurpose/webpos/webapp/webpos/shortcuts/Shortcuts.ftl (revision 0) @@ -0,0 +1,46 @@ +<#-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + + + + + +
+
    +
    + +
    + \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/buttons/Numbers.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/buttons/Numbers.ftl (revision 1096554) +++ specialpurpose/webpos/webapp/webpos/buttons/Numbers.ftl (working copy) @@ -1,64 +0,0 @@ -<#-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> - -
    - - - - - - - - - - - - - - - - - - - - -
    - 1 - - 2 - - 3 -
    - 4 - - 5 - - 6 -
    - 7 - - 8 - - 9 -
    - 0 - - ${uiLabelMap.WebPosButtonReturn} -
    -
    Index: specialpurpose/webpos/webapp/webpos/buttons/Promo.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/buttons/Promo.ftl (revision 1096554) +++ specialpurpose/webpos/webapp/webpos/buttons/Promo.ftl (working copy) @@ -1,36 +0,0 @@ -<#-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> - - - - - - - -
    - <#if isOpen?default(false) == true> - ${uiLabelMap.WebPosButtonPromoCode} - <#else> - ${uiLabelMap.WebPosButtonPromoCode} - - - ${uiLabelMap.WebPosButtonMain} - -   -
    \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/buttons/Payment.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/buttons/Payment.ftl (revision 1096554) +++ specialpurpose/webpos/webapp/webpos/buttons/Payment.ftl (working copy) @@ -1,81 +0,0 @@ -<#-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> - - - - - - - - - - - - - - - - - -
    - ${uiLabelMap.WebPosButtonPayCash} - - ${uiLabelMap.WebPosButtonPayCheck} - - ${uiLabelMap.WebPosButtonPayGiftCard} -
    - ${uiLabelMap.WebPosButtonPayCreditCard} - - <#if (totalDue = 0.00)> - ${uiLabelMap.WebPosButtonPayFinish} - <#else> - ${uiLabelMap.WebPosButtonPayFinish} - - - <#if (totalPayments > 0.00)> - ${uiLabelMap.WebPosButtonPaySetRef} - <#else> - ${uiLabelMap.WebPosButtonPaySetRef} - -
    - <#if (totalPayments > 0.00)> - ${uiLabelMap.WebPosButtonPayClear} - <#else> - ${uiLabelMap.WebPosButtonPayClear} - - - <#if (totalPayments > 0.00)> - ${uiLabelMap.WebPosButtonPayClearAll} - <#else> - ${uiLabelMap.WebPosButtonPayClearAll} - - - ${uiLabelMap.WebPosButtonMain} -
    -<#if cart?has_content> - <#if (totalDue > 0.00)> -
    -

    ${uiLabelMap.WebPosTransactionTotalDue} <@ofbizCurrency amount=totalDue isoCode=cart.getCurrency()/>

    -
    - <#else> -
    -

    ${uiLabelMap.WebPosCompleteSale}

    -
    - - \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/buttons/Main.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/buttons/Main.ftl (revision 1096554) +++ specialpurpose/webpos/webapp/webpos/buttons/Main.ftl (working copy) @@ -1,122 +0,0 @@ -<#-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - ${uiLabelMap.WebPosButtonMain} - -   - - <#if isManagerLoggedIn?default(false) == true> - ${uiLabelMap.WebPosButtonManager} - <#else> - ${uiLabelMap.WebPosButtonManager} - -
    - ${uiLabelMap.WebPosButtonPromo} - -   - - <#if (shoppingCartSize > 0)> - ${uiLabelMap.WebPosButtonPayment} - <#else> - ${uiLabelMap.WebPosButtonPayment} - -
    - <#if (shoppingCartSize > 0)> - ${uiLabelMap.WebPosRecalculateCart} - <#else> - ${uiLabelMap.WebPosRecalculateCart} - - - <#if (shoppingCartSize > 0)> - ${uiLabelMap.WebPosEmptyCart} - <#else> - ${uiLabelMap.WebPosEmptyCart} - - - <#if (shoppingCartSize > 0)> - ${uiLabelMap.WebPosRemoveSelected} - <#else> - ${uiLabelMap.WebPosRemoveSelected} - -
    - NAN GIZMO - - PURPLE GIZMO - - ROUND GIZMO -
    - SQUARE GIZMO - - MASSIVE GIZMO - - TINY WIDGET -
    - RAINBOW GIZMO - - NIT GIZMO - - BIG GIZMO -
    - MICRO WIDGET - -   - - <#if userLogin?has_content && userLogin.userLoginId != "anonymous"> - ${uiLabelMap.WebPosButtonLogout} - <#else/> - ${uiLabelMap.WebPosButtonLogin} - -
    \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/buttons/Manager.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/buttons/Manager.ftl (revision 1096554) +++ specialpurpose/webpos/webapp/webpos/buttons/Manager.ftl (working copy) @@ -1,78 +0,0 @@ -<#-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> - - - - - - - - - - - - - - - - - -
    - <#if isManagerLoggedIn?default(false) == true && isOpen?default(false) == false> - ${uiLabelMap.WebPosButtonOpenTerminal} - <#else> - ${uiLabelMap.WebPosButtonOpenTerminal} - - - <#if isManagerLoggedIn?default(false) == true && isOpen?default(false) == true> - ${uiLabelMap.WebPosButtonCloseTerminal} - <#else> - ${uiLabelMap.WebPosButtonCloseTerminal} - - - <#if isManagerLoggedIn?default(false) == true && isOpen?default(false) == true> - ${uiLabelMap.WebPosButtonVoidOrder} - <#else> - ${uiLabelMap.WebPosButtonVoidOrder} - -
    - <#if isManagerLoggedIn?default(false) == true> - ${uiLabelMap.WebPosButtonShutdown} - <#else> - ${uiLabelMap.WebPosButtonShutdown} - - - <#if isManagerLoggedIn?default(false) == true && isOpen?default(false) == true> - ${uiLabelMap.WebPosButtonPaidIn} - <#else> - ${uiLabelMap.WebPosButtonPaidIn} - - - <#if isManagerLoggedIn?default(false) == true && isOpen?default(false) == true> - ${uiLabelMap.WebPosButtonPaidOut} - <#else> - ${uiLabelMap.WebPosButtonPaidOut} - -
    - ${uiLabelMap.WebPosButtonModifyPrice} - - ${uiLabelMap.WebPosButtonMain} - -   -
    \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/customer/EditAddress.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/customer/EditAddress.ftl (revision 0) +++ specialpurpose/webpos/webapp/webpos/customer/EditAddress.ftl (revision 0) @@ -0,0 +1,98 @@ +<#-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/webpos.css =================================================================== --- specialpurpose/webpos/webapp/webpos/images/webpos.css (revision 1096554) +++ specialpurpose/webpos/webapp/webpos/images/webpos.css (working copy) @@ -40,61 +40,42 @@ } .tableButtons { - background-color: #FFFFF; - color: #FFFF00; width: 100%; height: 100%; } .tableButtons td { - background-color: #000099; - background-image: url(/images/gradient_sub_uns.gif); + border: 1px solid #0099CC; + background-color: #fece2f; background-repeat: repeat-x; - height: 1em; text-align: center; border-width: 2px; padding-left: 0.5em; height: 5em; width: 5em; -} -.posButton, A.posButton, A.posButton:visited { - color: #ffff00; - font-size: 0.9em; - font-weight: bold; - padding-left: 0.2em; - padding-right: 0.5em; } - -A.posButton:hover { - color: #ffff00; -} - -div#panel { - border: solid 2px #EBEFF7; - background-color: #CCFFFF; - padding: 10px; - top: 250px; - left: 200px; - position: absolute; - color: #333; +.pos-cart-odd { + background-color: white; overflow: auto; } - -div.pos-cart-scroll { - height: 370px; - width: 100%; +.pos-cart-odd:hover { + background-color: #FFFCCF; + cursor: pointer; +} +.pos-cart-even { + background-color: #eeeeee; overflow: auto; } - -.pos-cart-hover-bar:hover { +.pos-cart-even:hover { background-color: #FFFCCF; cursor: pointer; } - +.pos-cart-choose { + background: #fece2f 50% 50% repeat-x; +} .errorPosMessage { background-color: #FF0000; - border: solid #000000 0.1em; font-size: 1.1em; font-weight: bold; text-align: center; @@ -103,45 +84,356 @@ color: #FFFCCF; overflow: auto; } - -/* ===== Header Styles ===== */ -#webpos-header { - position: relative; - background: #ffffff; +#posButton { + list-style-type: none; + margin: 0; + padding: 0; +} +#posButton li { + margin: 2px; + padding: 1px; + float: left; + width: 60px; + height: 60px; + line-height: 10px; + font-size: 0.90em; + text-align: center; + overflow: hidden; +} +.notSelectedButton { + border: 1px solid #d19405; + background: #fece2f 50% 50% repeat-x; + font-weight: bold; + color: black; + outline: none; +} +.notSelectedButton a, .notSelectedButton a:link, .notSelectedButton a:visited, .notSelectedButton a:hover { + color: black; + text-decoration: none; + outline: none; +} +.selectedButton { + border: 1px solid #d19405; + background: #f39814 50% 50% repeat-x; + font-weight: bold; + color: white; + outline: none; +} +.selectedButton a, .selectedButton a:link, .selectedButton a:visited, .selectedButton a:hover { + color: white; + text-decoration: none; + outline: none; + cursor: hand; +} +.linkButton { + width: 60px; + height: 40px; + line-height: 10px; + font-size: 0.90em; + text-align: center; + overflow: hidden; +} +#posShortcut { + list-style-type: none; + margin: 0; + padding: 0; +} +#posShortcut li { + margin: 2px; + padding: 1px; + float: left; + width: 60px; + height: 60px; + line-height: 20px; + font-size: 0.90em; + text-align: center; +} +.notSelectedShortcut { + border: 1px solid #d19405; + background: #fece2f 50% 50% repeat-x; + font-weight: bold; + color: black; + outline: none; +} +.notSelectedShortcut a, .notSelectedShortcut a:link, .notSelectedShortcut a:visited, .notSelectedShortcut a:hover { + color: black; + text-decoration: none; + outline: none; +} +.selectedShortcut { + border: 1px solid #d19405; + background: #f39814 50% 50% repeat-x; + font-weight: bold; + color: white; + outline: none; +} +.selectedShortcut a, .selectedShortcut a:link, .selectedShortcut a:visited, .selectedShortcut a:hover { + color: white; + text-decoration: none; + outline: none; + cursor: hand; +} +input[type="text"]:focus, input[type="password"]:focus { + border: 1px solid #0099CC; + background: #FFFCCF; +} +#TopBar { + height: 130px; + width: 100%; +} +#TopBar .leftTopBar { + float: left; + width: 58%; +} +#TopBar .rightTopBar { + float: right; + width: 40%; +} +#centerTopBarLeft { + float: left; + margin-left: 5px; + margin-right: 5px; + width: auto; +} +#centerTopBarRight { + float: right; + margin-left: 5px; + margin-right:5px; + width: auto; +} +#SearchProducts { height: 100px; - voice-family: "\"}\""; - voice-family: inherit; } -#webpos-header #left { +#searchProductsResults { + border: solid 4px #0099CC; + background-color: #CCFFFF; position: absolute; top: 0px; - left: 0px; - width: 280px; + left: 25%; + width: 50%; + height: 280px; + overflow-x: hidden; + overflow-y: auto; } -#webpos-header #middle { - margin-left: 290px; - margin-right: 210px; - padding-top: 10px; - width: auto; - text-align: center; +.searchProductsResultsHead { + height: 30px; } -#webpos-header #right { +.searchProductsResultsCartBody { + height: 186px; + max-height: 186px; + overflow-x: hidden; + overflow-y: auto; +} +#searchPartiesResults { + border: solid 4px #0099CC; + background-color: #CCFFFF; position: absolute; top: 0px; - right: 0px; - width: 200px; - padding: 0px; - margin-top: 20px; - text-align: right; + right: 0%; + width: 65%; + height: 280px; + overflow-x: hidden; + overflow-y: auto; } -#webpos-header #middle { - margin-left: 290px; - margin-right: 210px; - padding-top: 10px; +.searchPartiesResultsHead { + height: 30px; +} +.searchPartiesResultsCartBody { + height: 168px; + max-height: 168px; + overflow-x: hidden; + overflow-y: auto; +} +#SearchSalesRepsList { + border: 1px solid #0099CC; + overflow: auto; + height: 120px; +} +#SearchSalesReps { + height: 110px; +} +#CustomerAddressList { + height: 120px; +} +#customerAddress { + border: 1px solid #0099CC; + overflow: auto; + height: 110px; +} +#billingAddressSelected { + color: white; +} +#shippingAddressSelected { + color: white; +} +.selectedAddress { + border: 1px solid #0099CC; + background-color: #fece2f; +} +#CenterBar { + margin-top: 33px; + height: auto; +} +.leftCenterBar { + float: left; + width: 24em; + margin-right: 1em; +} +.rightCenterBar { + float: right; + margin-left: 1em; + width: 24em; +} +.centerCenterBar { + margin-left: 24em; + margin-right: 24em; width: auto; +} +#CartHeader { + height: 100px; + width: 100%; +} +#Cart { + height: 460px; + width: 100%; +} +.basic-table .CartHead { + height: 30px; +} +.basic-table .CartBody { + height: 400px; + overflow-x: hidden; + overflow-y: auto; +} +.basic-table .CartFoot { + height: 30px; +} +#CartItemSelected { + height: 130px; + overflow: auto; +} +#CartItemSelectedLeft { + float: left; +} +#CartItemSelectedRight { + float: right; +} +#chooseVariant { + border: solid 4px #0099CC; + background-color: #CCFFFF; + position: absolute; + top: 300px; + left: 40%; + width: 20%; + height: 280px; +} +#payCash { + border: solid 4px #0099CC; + background-color: #CCFFFF; + position: absolute; + top: 300px; + left: 40%; + width: 20%; + height: 180px; +} +#payCheck { + border: solid 4px #0099CC; + background-color: #CCFFFF; + position: absolute; + top: 300px; + left: 39%; + width: 22%; + height: 210px; +} +#payGiftCard { + border: solid 4px #0099CC; + background-color: #CCFFFF; + position: absolute; + top: 300px; + left: 38%; + width: 24%; + height: 210px; +} +#payCreditCard { + border: solid 4px #0099CC; + background-color: #CCFFFF; + position: absolute; + top: 300px; + left: 23%; + width: 54%; + height: 310px; +} +#payFinish { + border: solid 4px #0099CC; + background-color: #CCFFFF; + position: absolute; + top: 300px; + left: 40%; + width: 20%; + height: 110px; +} +#openTerminal { + border: solid 4px #0099CC; + background-color: #CCFFFF; + position: absolute; + top: 300px; + left: 38%; + width: 24%; + height: 130px; +} +#closeTerminal { + border: solid 4px #0099CC; + background-color: #CCFFFF; + position: absolute; + top: 300px; + left: 30%; + width: 40%; + height: 250px; +} +#paidOutAndIn { + border: solid 4px #0099CC; + background-color: #CCFFFF; + position: absolute; + top: 300px; + left: 30%; + width: 40%; + height: 200px; +} +#promo { + border: solid 4px #0099CC; + background-color: #CCFFFF; + position: absolute; + top: 300px; + left: 36%; + width: 28%; + height: 150px; +} +#voidOrder { + border: solid 4px #0099CC; + background-color: #CCFFFF; + position: absolute; + top: 300px; + left: 30%; + width: 40%; + height: 130px; +} +#editAddress { + border: solid 4px #0099CC; + background-color: #CCFFFF; + position: absolute; + top: 300px; + left: 20%; + width: 60%; + height: 200px; +} +#pleaseWait { + border: 1px solid #d19405; + background: #fece2f url(/images/ajax-loader.gif) no-repeat center left; + position: absolute; + top: 50px; + left: 85%; + width: 13%; + height: 20px; text-align: center; -} -#webpos-header #middle-right { - margin-left: 290px; - width: auto; + vertical-align: middle; } \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/ChooseVariant.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/ChooseVariant.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/ChooseVariant.js (revision 0) @@ -0,0 +1,295 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +var variantData = null; + +jQuery(document).ready(function() { + jQuery('#variantQuantity').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + variantConfirmed(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#chooseVariantConfirm').bind('click', function(event) { + variantConfirmed(); + return false; + }); + + jQuery('#chooseVariantCancel').bind('click', function(event) { + productToSearchFocus(); + return false; + }); +}); + +function variantConfirmed() { + pleaseWait('Y'); + if (jQuery('#variant').val() == 'Y') { + var param = 'add_product_id=' + jQuery('#variantProductId').val() + '&quantity=' + jQuery('#variantQuantity').val() + + '&add_amount=' + jQuery('#amount').val(); + jQuery.ajax({url: 'AddToCart', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfVariantAddItem(data); + }, + error: function(data) { + getResultOfVariantAddItem(data); + } + }); + } else { + jQuery.ajax({url: 'AddToCart', + data: jQuery('#ChooseVariantForm').serialize(), + type: 'post', + async: false, + success: function(data) { + getResultOfVariantAddItem(data); + }, + error: function(data) { + getResultOfVariantAddItem(data); + } + }); + } + pleaseWait('N'); +} + +function getResultOfVariantAddItem(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + clearErrorMessages(); + updateCart(); + productToSearchFocus(); + } +} + +function chooseVariant(cleanErrors, data) { + if (cleanErrors == undefined) { + cleanErrors = "Y"; + } + if (cleanErrors == "Y") { + hideOverlayDiv(); + jQuery('#chooseVariantFormServerError').html(""); + jQuery('#variantQuantity').val("1"); + } + variantData = data; + + var requireAmount = data.product.requireAmount; + if (requireAmount == null) { + requireAmount = "N"; + } + if (requireAmount == "Y") { + jQuery('#addAmount').show(); + } else { + jQuery('#addAmount').hide(); + } + + var virtualVariantMethodEnum = data.product.virtualVariantMethodEnum; + if (virtualVariantMethodEnum == null) { + virtualVariantMethodEnum = "VV_VARIANTTREE"; + } + if (virtualVariantMethodEnum == "VV_VARIANTTREE") { + selectVariant(variantData, 'Y'); + } + if (virtualVariantMethodEnum == "VV_FEATURETREE") { + selectFeature(variantData, 'Y', data.product.productId); + } +} + +function selectVariant(data, firstTime) { + var variantTree = data.variantTree; + var variantTreeSize = data.variantTreeSize; + var featureOrder = data.featureOrder; + var featureTypes = data.featureTypes; + var variantSampleList = data.variantSampleList; + var selectList = ""; + var featureValue = ""; + if (variantTree != undefined && variantTreeSize > 0) { + if (featureOrder != undefined && featureOrder.length > 0) { + if (variantSampleList != undefined && variantSampleList.length > 0) { + if (featureTypes != undefined) { + var idx = 0; + var previousFeatureValue = ""; + jQuery.each(featureOrder, function(i, actualFeature) { + var feature = featureTypes[actualFeature]; + if (idx == 0) { + selectList = selectList + feature + " "; + selectList = selectList + "
    "; + } else { + var features = variantTree[previousFeatureValue]; + selectList = selectList + feature + " "; + selectList = selectList + "
    "; + } + idx++; + previousFeatureValue = featureValue; + }); + jQuery('#features').html(selectList); + var idx = 0; + var features = variantTree; + jQuery.each(featureOrder, function(i, actualFeature) { + var feature = featureTypes[actualFeature]; + featureValue = "FT" + feature; + jQuery('#' + featureValue).bind('change', function(event) { + selectVariant(variantData, 'N'); + return false; + }); + var featValue = jQuery('#' + featureValue).val(); + idx++; + for (var key in features) { + if (key == featValue) { + if (idx == featureOrder.length) { + jQuery('#variantProductId').val(features[key]); + var param = 'productId=' + jQuery('#variantProductId').val(); + jQuery.ajax({url: 'GetProductAndPrice', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfGetProductAndPrice(data); + }, + error: function(data) { + getResultOfGetProductAndPrice(data); + } + }); + } else { + features = features[key]; + } + } + } + }); + } + } + } + } + jQuery('#variant').val('Y'); + jQuery('#features').show(); + jQuery('#chooseVariant').show(); + jQuery('#variantQuantity').focus(); +} + +function selectFeature(data, firstTime, productId) { + var featureLists = data.featureLists; + if (featureLists != undefined && featureLists.length > 0) { + var selectList = ""; + for (i = 0; i < featureLists.length; i++) { + featureList = featureLists[i]; + for (j = 0; j < featureList.length; j++) { + var feature = featureList[j]; + if (j == 0) { + selectList = selectList + feature.description + " "; + selectList = selectList + "
    "; + } + jQuery('#variantProductId').val(productId); + jQuery('#features').html(selectList); + } + jQuery('#variant').val('N'); + jQuery('#features').show(); + jQuery('#chooseVariant').show(); + jQuery('#variantQuantity').focus(); +} + +function getResultOfGetProductAndPrice(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#chooseVariantFormServerError').update(serverError); + chooseVariant('N', data); + } else { + clearErrorMessages(); + var product = data.product; + var price = data.price; + var currencyUomId = data.currencyUomId; + if (product.productName != null) { + jQuery('#variantProductDescription').update(product.productName); + } else if (product.productDescription != null) { + jQuery('#variantProductDescription').update(product.productDescription); + } else if (product.longDescription != null) { + jQuery('#variantProductDescription').update(product.longDescription); + } + var formattedPrice = getFormattedAmount(price, currencyUomId); + jQuery('#variantProductPrice').update(formattedPrice); + } +} + +function getFormattedProductFeaturePrice(productFeatureIdIn, productPriceTypeIdIn, currencyUomIdIn) { + var formattedAmount = ""; + var param = 'productFeatureId=' + productFeatureIdIn + '&productPriceTypeId=' + productPriceTypeIdIn + '¤cyUomId=' + currencyUomIdIn; + jQuery.ajax({url: 'GetFormattedProductFeaturePrice', + data: param, + type: 'post', + async: false, + success: function(data) { + formattedAmount = getResultOfGetFormattedProductFeaturePrice(data); + }, + error: function(data) { + formattedAmount = getResultOfGetFormattedProductFeaturePrice(data); + } + }); + return formattedAmount; +} + +function getResultOfGetFormattedProductFeaturePrice(data) { + return data.formattedFeaturePrice; +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/WebPosHotkeys.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/WebPosHotkeys.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/WebPosHotkeys.js (revision 0) @@ -0,0 +1,9 @@ +WebPosHotkeys = { + hotkeys: [], + + bind: function (type, data, fnCode, fn, label) { + var arr = [type, data, fnCode, fn, label]; + this.hotkeys.push(arr); + $(document).bind(type, data, fnCode); + } +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/SearchProductsResults.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/SearchProductsResults.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/SearchProductsResults.js (revision 0) @@ -0,0 +1,130 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +jQuery(document).ready(function() { + jQuery('#searchByProductIdValue').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + productSearchAgain(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#searchByProductName').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + productSearchAgain(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#searchByProductDescription').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + productSearchAgain(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#searchProductsResultsSearch').bind('click', function(event) { + productSearchAgain(); + }); + + jQuery('#searchProductsResultsCancel').bind('click', function(event) { + jQuery('#searchProductsResults').hide(); + productToSearchFocus(); + }); +}); + +function buildProductsResults(products, fromProductSearch) { + var alt_row = false; + var idx = 1; + var tableList = ""; + jQuery.each(products, function(i, product) { + if (alt_row) { + classType = "class=\"pos-cart-even\""; + } else { + classType = "class=\"pos-cart-odd\""; + } + productName = checkNull(product.productName); + productDescription = checkNull(product.description); + tableList = tableList + ""; + tableList = tableList + ""; + tableList = tableList + "" + product.productId + ""; + tableList = tableList + "" + productName + ""; + tableList = tableList + "" + productDescription + ""; + tableList = tableList + ""; + alt_row = !alt_row; + idx++; + }); + jQuery('#searchProductsResultsList').html(tableList); + jQuery('#searchProductsResults').show(); + if (fromProductSearch == 'Y') { + if (jQuery('#searchBy').val() == 'productName') { + jQuery('#searchByProductIdValue').val(""); + jQuery('#searchByProductName').val(jQuery('#productToSearch').val()); + jQuery('#searchByProductDescription').val(""); + jQuery('#searchByProductName').focus(); + } + if (jQuery('#searchBy').val() == 'productDescription') { + jQuery('#searchByProductIdValue').val(""); + jQuery('#searchByProductName').val(""); + jQuery('#searchByProductDescription').val(jQuery('#productToSearch').val()); + jQuery('#searchByProductDescription').focus(); + } + if (jQuery('#searchBy').val() == 'idValue') { + jQuery('#searchByProductIdValue').val(jQuery('#productToSearch').val()); + jQuery('#searchByProductName').val(""); + jQuery('#searchByProductDescription').val(""); + jQuery('#searchByProductIdValue').focus(); + } + } +} + +function productSearchAgain() { + pleaseWait('Y'); + var param = 'goodIdentificationTypeId=' + jQuery('#goodIdentificationTypeId').val() + + '&searchByProductName=' + jQuery('#searchByProductName').val() + + '&searchByProductDescription=' + jQuery('#searchByProductDescription').val() + + '&searchByProductIdValue=' + jQuery('#searchByProductIdValue').val(); + jQuery.ajax({url: 'FindProducts', + data: param, + type: 'post', + async: false, + success: function(data) { + var products = data.productsList; + buildProductsResults(products, 'N'); + }, + error: function(data) { + alert("Error during product searching again"); + } + }); + pleaseWait('N'); +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/PayCreditCard.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/PayCreditCard.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/PayCreditCard.js (revision 0) @@ -0,0 +1,241 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +jQuery(document).ready(function() { + jQuery('#removeCreditCardTotalPaid').bind('click', function(event) { + pleaseWait('Y'); + var param = 'clearCash=N&clearCheck=N&clearGift=N&clearCredit=Y'; + jQuery.ajax({url: 'ClearPayment', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfCreditCardClearPayment(data); + }, + error: function(data) { + getResultOfCreditCardClearPayment(data); + } + }); + pleaseWait('N'); + productToSearchFocus(); + return false; + }); + + jQuery('#swipeCard').bind('click', function(event) { + jQuery('#payCreditCard').show(); + if (jQuery('#swipeCard').val() == 'Y') { + jQuery('#swipeCard').val('N'); + jQuery('#swipeCard').checked = false; + jQuery('#showSwipeData').hide(); + jQuery('#showCreditCardData1').show(); + jQuery('#showCreditCardData2').show(); + jQuery('#firstName').focus(); + } else { + jQuery('#swipeCard').val('Y'); + jQuery('#swipeCard').checked = true; + jQuery('#showSwipeData').show(); + jQuery('#showCreditCardData1').hide(); + jQuery('#showCreditCardData2').hide(); + jQuery('#swipeData').focus(); + } + return false; + }); + + jQuery('#swipeData').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCreditCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#firstName').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCreditCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#lastName').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCreditCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#cardNum').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCreditCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#securityCode').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCreditCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#amountCreditCard').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCreditCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#postalCode').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCreditCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#refNumCreditCard').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCreditCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#payCreditCardConfirm').bind('click', function(event) { + payCreditCardConfirm(); + return false; + }); + + jQuery('#payCreditCardCancel').bind('click', function(event) { + productToSearchFocus(); + return false; + }); +}); + +function payCreditCardConfirm() { + pleaseWait('Y'); + var param = 'swipeCard=' + jQuery('#swipeCard').val() + '&swipeData=' + jQuery('#swipeData').val() + '&cardType=' + jQuery('#cardType').val() + + '&amountCreditCard=' + jQuery('#amountCreditCard').val() + '&refNum=' + jQuery('#refNumCreditCard').val() + '&cardNum=' + jQuery('#cardNum').val() + + '&expMonth=' + jQuery('#expMonth').val() + '&expYear=' + jQuery('#expYear').val() + '&securityCode=' + jQuery('#securityCode').val() + + '&postalCode=' + jQuery('#postalCode').val() + '&firstName=' + jQuery('#firstName').val() + '&lastName=' + jQuery('#lastName').val() + + '&track2=' + jQuery('#track2').val(); + jQuery.ajax({url: 'PayCreditCard', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfPayCreditCard(data); + }, + error: function(data) { + getResultOfPayCreditCard(data); + } + }); + pleaseWait('N'); +} + +function payCreditCard(cleanErrors) { + if (cleanErrors == undefined) { + cleanErrors = "Y"; + } + if (cleanErrors == "Y") { + hideOverlayDiv(); + jQuery('#payCreditCardFormServerError').html(""); + jQuery('#swipeCard').val('Y'); + jQuery('#swipeCard').checked = true; + jQuery('#swipeData').val(''); + jQuery('#firstName').val(''); + jQuery('#lastName').val(''); + jQuery('#cardNum').val(''); + jQuery('#securityCode').val(''); + jQuery('#postalCode').value = ''; + jQuery('#refNumCreditCard').val(''); + jQuery('#amountCreditCard').val(''); + jQuery('#showSwipeData').show(); + jQuery('#showCreditCardData1').hide(); + jQuery('#showCreditCardData2').hide(); + } + jQuery('#creditCardTotalDue').html(jQuery('#totalDueFormatted').val()); + jQuery('#creditCardTotalPaid').html(jQuery('#totalCreditFormatted').val()); + jQuery('#payCreditCard').show(); + if (jQuery('#swipeCard').val() == 'Y') { + jQuery('#swipeData').focus(); + } else { + jQuery('#firstName').focus(); + } + return false; +} + +function getResultOfPayCreditCard(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#payCreditCardFormServerError').html(serverError); + payCreditCard('N'); + } else { + clearErrorMessages(); + updateCart(); + productToSearchFocus(); + } +} + +function getResultOfCreditCardClearPayment(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + clearErrorMessages(); + updateCart(); + } +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/PaidOutAndIn.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/PaidOutAndIn.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/PaidOutAndIn.js (revision 0) @@ -0,0 +1,110 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +jQuery(document).ready(function() { + jQuery('#amountInOut').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + paidOutAndInConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#reasonCommentInOut').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + paidOutAndInConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#paidOutAndInConfirm').bind('click', function(event) { + paidOutAndInConfirm(); + return false; + }); + + jQuery('#paidOutAndInCancel').bind('click', function(event) { + productToSearchFocus(); + return false; + }); +}); + +function paidOutAndInConfirm() { + pleaseWait('Y'); + var param = 'type=' + jQuery('#paidType').val() + '&amountInOut=' + jQuery('#amountInOut').val() + + '&reasonIn=' + jQuery('#reasIn').val() + '&reasonOut=' + jQuery('#reasOut').val() + + '&reasonCommentInOut=' + jQuery('#reasonCommentInOut').val(); + jQuery.ajax({url: 'PaidOutAndIn', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfPaidOutAndIn(data); + }, + error: function(data) { + getResultOfPaidOutAndIn(data); + } + }); + pleaseWait('N'); +} + +function paidOutAndIn(cleanErrors, paidInOut) { + if (cleanErrors == undefined) { + cleanErrors = "Y"; + } + if (cleanErrors == "Y") { + hideOverlayDiv(); + jQuery('#paidOutAndInFormServerError').html(""); + jQuery('#amountInOut').val(""); + jQuery('#reasonCommentInOut').val(""); + } + jQuery('#paidType').val(paidInOut); + jQuery('#paidOutAndIn').show(); + if (paidInOut == 'IN') { + jQuery('#reasonIn').show(); + jQuery('#amountPaidIn').show(); + jQuery('#reasonOut').hide(); + jQuery('#amountPaidOut').hide(); + } else { + jQuery('#reasonIn').hide(); + jQuery('#amountPaidIn').hide(); + jQuery('#reasonOut').show(); + jQuery('#amountPaidOut').show(); + } + jQuery('#amountInOut').focus(); +} + +function getResultOfPaidOutAndIn(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#paidOutAndInFormServerError').html(serverError); + paidOutAndIn('N', jQuery('#paidType').val()); + } else { + clearErrorMessages(); + updateCart(); + productToSearchFocus(); + } +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/SearchPartiesResults.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/SearchPartiesResults.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/SearchPartiesResults.js (revision 0) @@ -0,0 +1,196 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +jQuery(document).ready(function() { + jQuery('#searchByPartyIdValue').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + partySearchAgain(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#searchByPartyLastName').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + partySearchAgain(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#searchByPartyFirstName').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + partySearchAgain(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#searchPartiesResultsSearch').bind('click', function(event) { + partySearchAgain(); + return false; + }); + + jQuery('#searchPartiesResultsCancel').bind('click', function(event) { + jQuery('#searchPartiesResults').hide(); + productToSearchFocus(); + return false; + }); +}); + +function buildPartiesResults(parties, fromPartySearch) { + var alt_row = false; + var idx = 1; + var tableList = ""; + jQuery.each(parties, function(i, party) { + if (alt_row) { + classType = "class=\"pos-cart-even\""; + } else { + classType = "class=\"pos-cart-odd\""; + } + lastName = checkNull(party.lastName); + firstName = checkNull(party.firstName); + address1 = checkNull(party.address1); + city = checkNull(party.city); + postalCode = checkNull(party.postalCode); + stateProvinceGeoId = checkNull(party.stateProvinceGeoId); + countryGeoId = checkNull(party.countryGeoId); + contactMechPurposeTypeId = checkNull(party.contactMechPurposeTypeId); + billingShipping = "B"; + if (contactMechPurposeTypeId == 'SHIPPING_LOCATION') { + billingShipping = "S"; + } + editAddr = "editAddress" + i; + selectedPartyId = "selectedPartyId" + i; + selectedContactMechId = "selectedContactMechId" + i; + selectedContactMechPurposeTypeId = "selectedContactMechPurposeTypeId" + i; + tableList = tableList + ""; + tableList = tableList + ""; + tableList = tableList + ""; + tableList = tableList + ""; + tableList = tableList + ""; + tableList = tableList + "" + party.partyId + ""; + tableList = tableList + "" + lastName + ""; + tableList = tableList + "" + firstName + ""; + tableList = tableList + "" + address1 + ""; + tableList = tableList + "" + city + ""; + tableList = tableList + "" + postalCode + ""; + tableList = tableList + "" + stateProvinceGeoId + ""; + tableList = tableList + "" + countryGeoId + ""; + tableList = tableList + "" + billingShipping + ""; + tableList = tableList + ""; + alt_row = !alt_row; + idx++; + }); + jQuery('#searchPartiesResultsList').html(tableList); + editAddressClick(); + jQuery('#searchPartiesResults').show(); + if (fromPartySearch == 'Y') { + if (jQuery('#searchPartyBy').val() == 'lastName') { + jQuery('#searchByPartyLastName').val(jQuery('#partyToSearch').val()); + jQuery('#searchByPartyFirstName').val(""); + jQuery('#searchByPartyIdValue').val(""); + jQuery('#searchByPartyLastName').focus(); + } else if (jQuery('#searchPartyBy').val() == 'firstName') { + jQuery('#searchByPartyLastName').val(""); + jQuery('#searchByPartyFirstName').val(jQuery('#partyToSearch').val()); + jQuery('#searchByPartyIdValue').val(""); + jQuery('#searchByPartyFirstName').focus(); + } else if (jQuery('#searchPartyBy').val() == 'idValue') { + jQuery('#searchByPartyLastName').val(""); + jQuery('#searchByPartyFirstName').val(""); + jQuery('#searchByPartyIdValue').val(jQuery('#partyToSearch').val()); + jQuery('#searchByPartyIdValue').focus(); + } + + if (jQuery('#billingLocation').val() == 'Y') { + jQuery('#billingLoc').val('Y'); + jQuery('#billingLoc').attr('checked', true); + } else { + jQuery('#billingLoc').val('N'); + jQuery('#billingLoc').attr('checked', false); + } + + if (jQuery('#shippingLocation').val() == 'Y') { + jQuery('#shippingLoc').val('Y'); + jQuery('#shippingLoc').attr('checked', true); + } else { + jQuery('#shippingLoc').val('N'); + jQuery('#shippingLoc').attr('checked', false); + } + } +} + +function editAddressClick() { + jQuery('input.editAddress').each(function(idx) { + var id = jQuery(this).attr('id'); + if (id != '') { + id = '#' + id; + jQuery(id).bind('click', function(event) { + editAddress(jQuery('#selectedPartyId' + idx).val(), jQuery('#selectedContactMechId' + idx).val(), jQuery('#selectedContactMechPurposeTypeId' + idx).val()); + return false; + }); + } + }); +} + +function partySearchAgain() { + pleaseWait('Y'); + var param = 'partyIdentificationTypeId=' + jQuery('#partyIdentificationTypeId').val() + + '&searchByPartyLastName=' + jQuery('#searchByPartyLastName').val() + + '&searchByPartyFirstName=' + jQuery('#searchByPartyFirstName').val() + + '&searchByPartyIdValue=' + jQuery('#searchByPartyIdValue').val(); + + if (jQuery('#billingLoc').attr('checked') == true) { + param = param + '&billingLocation=Y'; + } else { + param = param + '&billingLocation=N'; + } + + if (jQuery('#shippingLoc').attr('checked') == true) { + param = param + '&shippingLocation=Y'; + } else { + param = param + '&shippingLocation=N'; + } + + jQuery.ajax({url: 'FindParties', + data: param, + type: 'post', + async: false, + success: function(data) { + var parties = data.partiesList; + buildPartiesResults(parties, 'N'); + }, + error: function(data) { + alert("Error during party searching again"); + } + }); + pleaseWait('N'); +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/SideDeepCategory.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/SideDeepCategory.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/SideDeepCategory.js (revision 0) @@ -0,0 +1,22 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +function selectCategory(productCategoryId) { + jQuery('#SideDeepCategoryList').load('SideDeepCategory', {category_id:productCategoryId}); + jQuery('#CategoryDetailList').load('CategoryDetail', {productCategoryId:productCategoryId}); +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/ShowCartItemSelected.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/ShowCartItemSelected.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/ShowCartItemSelected.js (revision 0) @@ -0,0 +1,176 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +function cartItemSelectedEvents(focusOnQuantity) { + jQuery('#itemQuantity').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + updateCartItem(); + itemQuantityFocus(); + return false; + } + }); + + jQuery('#modifyPrice').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + modifyPrice(); + itemQuantityFocus(); + return false; + } + }); + + jQuery('#incrementQuantity').bind('click', function(event) { + incrementItemQuantity(); + return false; + }); + + jQuery('#decrementQuantity').bind('click', function(event) { + decrementItemQuantity(); + return false; + }); + + if (focusOnQuantity == undefined) { + focusOnQuantity = 'Y'; + } + if (focusOnQuantity == 'Y') { + itemQuantityFocus(); + } +} + +function incrementItemQuantity() { + var qnt = parseInt(jQuery('#itemQuantity').val()); + if (!isNaN(qnt)) { + qnt = qnt + 1; + jQuery('#itemQuantity').val(qnt); + updateCartItem(); + } + itemQuantityFocus(); + return false; +} + +function decrementItemQuantity() { + var qnt = parseInt(jQuery('#itemQuantity').val()); + if (!isNaN(qnt) && qnt > 1) { + qnt = qnt - 1; + jQuery('#itemQuantity').val(qnt); + updateCartItem(); + } + itemQuantityFocus(); + return false; +} + +function itemQuantityFocus() { + hideOverlayDiv(); + jQuery('#itemQuantity').focus(); + return false; +} + +function modifyPrice() { + pleaseWait('Y'); + var param = 'cartLineIdx=' + jQuery('#cartLineIdx').val() + '&price=' + jQuery('#modifyPrice').val(); + jQuery.ajax({url: 'ModifyPrice', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfModifyPrice(data); + }, + error: function(data) { + getResultOfModifyPrice(data); + } + }); + pleaseWait('N'); +} + +function getResultOfModifyPrice(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + jQuery('#itemQuantity').focus(); + } else { + clearErrorMessages(); + jQuery('#itemQuantity').focus(); + updateCart(); + } +} + +function updateCartItem() { + pleaseWait('Y'); + var param = 'cartLineIndex=' + jQuery('#lineIndex').val() + '&quantity=' + jQuery('#itemQuantity').val(); + jQuery.ajax({url: 'UpdateCartItem', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfUpdateCartItem(data); + }, + error: function(data) { + getResultOfUpdateCartItem(data); + } + }); + pleaseWait('N'); +} + +function getResultOfUpdateCartItem(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + jQuery('#itemQuantity').focus(); + } else { + clearErrorMessages(); + jQuery('#itemQuantity').focus(); + updateCart(); + } +} + +function deleteCartItem(cartLineIndex) { + pleaseWait('Y'); + var param = 'cartLineIndex=' + cartLineIndex; + jQuery.ajax({url: 'DeleteCartItem', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfDeleteCartItem(data); + }, + error: function(data) { + getResultOfDeleteCartItem(data); + } + }); + pleaseWait('N'); +} + +function getResultOfDeleteCartItem(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + jQuery('#productToSearch').focus(); + } else { + clearErrorMessages(); + jQuery('#productToSearch').focus(); + updateCart(); + updateCartItemSelected(null, 'N'); + } +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/SearchSalesReps.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/SearchSalesReps.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/SearchSalesReps.js (revision 0) @@ -0,0 +1,81 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +function removeSalesRep(salesRepId) { + pleaseWait('Y'); + var param = 'partyId=' + salesRepId; + jQuery.ajax({url: 'RemoveSalesRep', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfRemoveSalesRep(data); + }, + error: function(data) { + getResultOfRemoveSalesRep(data); + } + }); + pleaseWait('N'); +} + +function getResultOfRemoveSalesRep(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + clearErrorMessages(); + updateSearchSalesReps(); + productToSearchFocus(); + } +} + +function addSalesRep(salesRepId) { + pleaseWait('Y'); + var param = 'partyId=' + salesRepId; + jQuery.ajax({url: 'AddSalesRep', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfAddSalesRep(data); + }, + error: function(data) { + getResultOfAddSalesRep(data); + } + }); + pleaseWait('N'); +} + +function getResultOfAddSalesRep(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + clearErrorMessages(); + updateSearchSalesReps(); + productToSearchFocus(); + } +} + +function updateSearchSalesReps() { + jQuery('#SearchSalesReps').load('SearchSalesRepsList', {cartLineIndex:null}); +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/PayCheck.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/PayCheck.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/PayCheck.js (revision 0) @@ -0,0 +1,130 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +jQuery(document).ready(function() { + jQuery('#removeCheckTotalPaid').bind('click', function(event) { + pleaseWait('Y'); + var param = 'clearCash=N&clearCheck=Y&clearGift=Y&clearCredit=N'; + jQuery.ajax({url: 'ClearPayment', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfCashClearPayment(data); + }, + error: function(data) { + getResultOfCashClearPayment(data); + } + }); + pleaseWait('N'); + productToSearchFocus(); + return false; + }); + + jQuery('#amountCheck').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCheckConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#refNumCheck').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCheckConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#payCheckConfirm').bind('click', function(event) { + payCheckConfirm(); + return false; + }); + + jQuery('#payCheckCancel').bind('click', function(event) { + productToSearchFocus(); + return false; + }); +}); + +function payCheckConfirm() { + pleaseWait('Y'); + var param = 'amountCheck=' + jQuery('#amountCheck').val() + '&refNum=' + jQuery('#refNumCheck').val(); + jQuery.ajax({url: 'PayCheck', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfPayCheck(data); + }, + error: function(data) { + getResultOfPayCheck(data); + } + }); + pleaseWait('N'); +} + +function payCheck(cleanErrors) { + if (cleanErrors == undefined) { + cleanErrors = "Y"; + } + if (cleanErrors == "Y") { + hideOverlayDiv(); + jQuery('#payCheckFormServerError').html(""); + jQuery('#amountCheck').val(""); + jQuery('#refNumCheck').val(""); + } + jQuery('#checkTotalDue').html(jQuery('#totalDueFormatted').val()); + jQuery('#checkTotalPaid').html(jQuery('#totalCheckFormatted').val()); + jQuery('#payCheck').show(); + jQuery('#amountCheck').focus(); + return false; +} + +function getResultOfPayCheck(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#payCheckFormServerError').html(serverError); + payCheck('N'); + } else { + clearErrorMessages(); + updateCart(); + productToSearchFocus(); + } +} + +function getResultOfCheckClearPayment(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + clearErrorMessages(); + updateCart(); + } +} \ No newline at end of file Property changes on: specialpurpose/webpos/webapp/webpos/images/js/PayCheck.js ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Date Rev Author URL Id Added: svn:eol-style + native Index: specialpurpose/webpos/webapp/webpos/images/js/PromoCode.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/PromoCode.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/PromoCode.js (revision 0) @@ -0,0 +1,83 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +jQuery(document).ready(function() { + jQuery('#promoCode').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + promoCodeConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#promoCodeConfirm').bind('click', function(event) { + promoCodeConfirm(); + return false; + }); + + jQuery('#promoCodeCancel').bind('click', function(event) { + productToSearchFocus(); + return false; + }); +}); + +function promoCodeConfirm() { + pleaseWait('Y'); + var param = 'promoCode=' + jQuery('#promoCode').val(); + jQuery.ajax({url: 'PromoCode', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfPromoCode(data); + }, + error: function(data) { + getResultOfPromoCode(data); + } + }); + pleaseWait('N'); +} + +function promoCode(cleanErrors) { + if (cleanErrors == undefined) { + cleanErrors = "Y"; + } + if (cleanErrors == "Y") { + hideOverlayDiv(); + jQuery('#promoCodeFormServerError').html(""); + jQuery('#promoCode').val(""); + } + jQuery('#promo').show(); + jQuery('#promoCode').focus(); +} + +function getResultOfPromoCode(date) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#promoCodeFormServerError').html(serverError); + promoCode('N'); + } else { + clearErrorMessages(); + updateCart(); + productToSearchFocus(); + } +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/Common.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/Common.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/Common.js (revision 0) @@ -0,0 +1,215 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +jQuery(document).ready(function() { + activateHotKeys(); +}); + +function updateCart() { + jQuery('#CartList').load('ShowCart'); +} + +function updateCustomerAddress() { + jQuery('#CustomerAddressList').load('CustomerAddress'); +} + +function updateCartItemSelected(lineIndex, focusOnQnt) { + if (lineIndex == null) { + lineIndex = 0; + } + jQuery('#CartItemSelected').load('ShowCartItemSelected', {cartLineIndex:lineIndex, focusOnQuantity:focusOnQnt}); +} + +function addItem(product_Id, qnt, updCart) { + pleaseWait('Y'); + var param = 'productId=' + product_Id; + jQuery.ajax({url: 'GetProductType', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfCheckProductType(data, product_Id, qnt, updCart); + }, + error: function(data) { + getResultOfCheckProductType(data, product_Id, qnt, updCart); + } + }); + pleaseWait('N'); +} + +function getResultOfCheckProductType(data, productId, qnt, updCart) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + var isVirtual = data.product.isVirtual; + if (isVirtual == null) { + isVirtual = "N"; + } + if (isVirtual == "N") { + var param = 'add_product_id=' + productId + "&quantity=" + qnt; + jQuery.ajax({url: 'AddToCart', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfAddItem(data, updCart); + }, + error: function(data) { + getResultOfAddItem(data, updCart); + } + }); + } else { + chooseVariant('Y', data); + } + } +} + +function getResultOfAddItem(data, updCart) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + if (updCart == "Y") { + jQuery('#errors').fadeOut('slow'); + updateCart(); + if (data.itemId != undefined) { + updateCartItemSelected(data.itemId, 'N'); + } + jQuery('#productToSearch').val(''); + jQuery('#productToSearch').focus(); + } + } +} + +// Check server side error +function getServerError(data) { + var serverErrorHash = []; + var serverError = ""; + if (data._ERROR_MESSAGE_LIST_ != undefined) { + serverErrorHash = data._ERROR_MESSAGE_LIST_; + jQuery.each(serverErrorHash, function(i, error) { + serverError += error; + }); + } + if (data._ERROR_MESSAGE_ != undefined) { + serverError = data._ERROR_MESSAGE_; + } + return serverError; +} + +function hideOverlayDiv() { + jQuery('#payCash').hide(); + jQuery('#payCheck').hide(); + jQuery('#payGiftCard').hide(); + jQuery('#payCreditCard').hide(); + jQuery('#openTerminal').hide(); + jQuery('#closeTerminal').hide(); + jQuery('#paidOutAndIn').hide(); + jQuery('#promo').hide(); + jQuery('#voidOrder').hide(); + jQuery('#chooseVariant').hide(); + jQuery('#searchProductsResults').hide(); + jQuery('#searchPartiesResults').hide(); + jQuery('#editAddress').hide(); + pleaseWait('N'); +} + +function pleaseWait(wait) { + if (wait == "Y") { + jQuery('#pleaseWait').show(); + } + else { + jQuery('#pleaseWait').hide(); + } +} + +function getFormattedAmount(amountStr, currencyStr) { + var formattedAmount = ""; + var param = 'amount=' + amountStr + "¤cyId=" + currencyStr; + jQuery.ajax({url: 'GetFormattedAmount', + data: param, + type: 'post', + async: false, + success: function(data) { + formattedAmount = getResultOfGetFormattedAmount(data); + }, + error: function(data) { + formattedAmount = getResultOfGetFormattedAmount(data); + } + }); + return formattedAmount; +} + +function getResultOfGetFormattedAmount(data) { + return data.formattedAmount; +} + +function emptyCart() { + pleaseWait('Y'); + jQuery.ajax({url: 'EmptyCart', + type: 'post', + async: false, + success: function(data) { + getResultOfEmptyCart(data); + }, + error: function(data) { + getResultOfEmptyCart(data); + } + }); + pleaseWait('N'); + return false; +} + +function getResultOfEmptyCart(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + jQuery('#errors').fadeOut('slow'); + updateCart(); + updateCartItemSelected(null, 'N'); + updateCustomerAddress(); + hideOverlayDiv(); + clearSearchResults(); + } + productToSearchFocus(); +} + +function clearSearchResults() { + jQuery('#productToSearch').val( ''); + jQuery('#partyToSearch').val(''); +} + +function checkNull(fieldToCheck) { + if (fieldToCheck == null) { + return ""; + } else { + return fieldToCheck; + } +} + +function clearErrorMessages() { + jQuery('#errors').fadeOut('slow'); +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/PayCash.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/PayCash.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/PayCash.js (revision 0) @@ -0,0 +1,117 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +jQuery(document).ready(function() { + jQuery('#removeCashTotalPaid').click(function(event) { + pleaseWait('Y'); + var param = 'clearCash=Y&clearCheck=N&clearGift=N&clearCredit=N'; + jQuery.ajax({url: 'ClearPayment', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfCashClearPayment(data); + }, + error: function(data) { + getResultOfCashClearPayment(data); + } + }); + pleaseWait('N'); + productToSearchFocus(); + return false; + }); + + jQuery('#amountCash').keypress(function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payCashConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#payCashConfirm').click(function(event) { + payCashConfirm(); + return false; + }); + + jQuery('#payCashCancel').click(function(event) { + productToSearchFocus(); + return false; + }); +}); + +function payCashConfirm() { + pleaseWait('Y'); + var param = 'amountCash=' + jQuery('#amountCash').val(); + jQuery.ajax({url: 'PayCash', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfPayCash(data); + }, + error: function(data) { + getResultOfPayCash(data); + } + }); + pleaseWait('N'); +} + +function payCash(cleanErrors) { + if (cleanErrors == undefined) { + cleanErrors = "Y"; + } + if (cleanErrors == "Y") { + hideOverlayDiv(); + jQuery('#payCashFormServerError').html(""); + jQuery('#amountCash').val(""); + } + jQuery('#cashTotalDue').html(jQuery('#totalDueFormatted').val()); + jQuery('#cashTotalPaid').html(jQuery('#totalCashFormatted').val()); + jQuery('#payCash').show(); + jQuery('#amountCash').focus(); + return false; +} + +function getResultOfPayCash(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#payCashFormServerError').html(serverError); + payCash('N'); + } else { + clearErrorMessages(); + updateCart(); + productToSearchFocus(); + } +} + +function getResultOfCashClearPayment(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + clearErrorMessages(); + updateCart(); + } +} \ No newline at end of file Property changes on: specialpurpose/webpos/webapp/webpos/images/js/PayCash.js ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Date Rev Author URL Id Added: svn:eol-style + native Index: specialpurpose/webpos/webapp/webpos/images/js/SearchProducts.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/SearchProducts.js (revision 1096554) +++ specialpurpose/webpos/webapp/webpos/images/js/SearchProducts.js (working copy) @@ -16,78 +16,60 @@ specific language governing permissions and limitations under the License. */ - -jQuery(document).ready( function() { - - // Autocompleter for good identification field - var productsIdent = []; - var productsIdIdent = []; - - jQuery( "#productGoodIdentification" ).autocomplete({ - minLength: 2, - source: function( request, response ) { - var term = request.term; - term = 'productGoodIdentification=' + term; - jQuery.ajax({ - url: "FindProductsByIdentification", - type: 'POST', - async: false, - data: term, - success: function(data) { - productsIdent = data.productsList; - productsIdIdent = data.productsId; - response( productsIdent ); - } +jQuery(document).ready(function() { + productToSearchFocus(); - }); - }, - select: function( event, ui ) { - var identValues = ui.item.value; - - jQuery.each(productsIdent, function(product) { - if (identValues == this) { - document.getElementById('add_product_id').value = productsIdIdent[product]; - return false; - } - }); + jQuery('#productToSearch').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + productSearch(); + return false; } }); - - // Autocompleter for search by field - jQuery('#searchBy').change( function(s) { - document.getElementById('add_product_id').value = ''; - document.getElementById('productToSearch').value = ''; - jQuery('#productToSearch').focus(); + + jQuery('#searchBy').bind('change', function(event) { + productToSearchFocus(); + return false; }); - jQuery( "#productToSearch" ).autocomplete({ - minLength: 2, - source: function( request, response ) { - var term = request.term; - term = 'searchBy=' + document.getElementById('searchBy').value + '&productToSearch=' + term; - jQuery.ajax({ - url: "FindProducts", - async: false, - type: 'POST', - data: term, - success: function(data) { - products = data.productsList; - productsId = data.productsId; - response( products ); - } - - }); + jQuery('#productSearchConfirm').bind('click', function(event) { + productSearch(); + return false; + }); +}); + +function productToSearchFocus() { + hideOverlayDiv(); + jQuery('#productToSearch').focus(); + return false; +} + +function productSearch() { + pleaseWait('Y'); + var param = 'goodIdentificationTypeId=' + jQuery('#goodIdentificationTypeId').val(); + if (jQuery('#searchBy').val() == "productName") { + param = param + '&searchByProductName=' + jQuery('#productToSearch').val(); + } else if (jQuery('#searchBy').val() == "productDescription") { + param = param + '&searchByProductDescription=' + jQuery('#productToSearch').val(); + } else if (jQuery('#searchBy').val() == "idValue") { + param = param + '&searchByProductIdValue=' + jQuery('#productToSearch').val(); + } + jQuery.ajax({url: 'FindProducts', + data: param, + type: 'post', + async: false, + success: function(data) { + var products = data.productsList; + // automatically add item to cart if returned only one product + if (products.length == 1) { + addItem(products[0].productId, '1', 'Y'); + } else { + buildProductsResults(products, 'Y'); + } }, - select: function( event, ui ) { - var productToSearchValues = ui.item.value; - - jQuery.each(products, function(product){ - if (productToSearchValues == this) { - document.getElementById('add_product_id').value = productsId[product]; - return false; - } - }); + error: function(data) { + alert("Error during product searching"); } }); - -}); \ No newline at end of file + pleaseWait('N'); +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/PayFinish.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/PayFinish.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/PayFinish.js (revision 0) @@ -0,0 +1,50 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +function payFinish() { + pleaseWait('Y'); + jQuery.ajax({url: 'PayFinish', + type: 'post', + async: false, + success: function(data) { + getResultOfPayFinish(data); + }, + error: function(data) { + getResultOfPayFinish(data); + } + }); + pleaseWait('N'); + return false; +} + +function getResultOfPayFinish(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + clearErrorMessages(); + updateCart(); + updateCartItemSelected(null, 'N'); + updateCustomerAddress(); + hideOverlayDiv(); + clearSearchResults(); + } + productToSearchFocus(); +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/ShowCart.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/ShowCart.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/ShowCart.js (revision 0) @@ -0,0 +1,66 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +function selectCartItem() { + jQuery('tr.pos-cart-even').each(function(idx) { + var id = jQuery(this).attr('id'); + if (id != '') { + id = '#' + id; + jQuery(id).bind('click', function(event) { + showCartItemSelected(id); + }); + } + }); + jQuery('tr.pos-cart-odd').each(function(idx) { + var id = jQuery(this).attr('id'); + if (id != '') { + id = '#' + id; + jQuery(id).bind('click', function(event) { + showCartItemSelected(id); + }); + } + }); +} + +function showCartItemSelected(itemId) { + var lineIndex = itemId.substring(9, 10); + updateCartItemSelected(lineIndex, 'Y'); + jQuery('#selectedItem').val(lineIndex); +} + +function keyUp() { + var selectedItem = parseInt(jQuery('#selectedItem').value); + var cartSize = parseInt(jQuery('#cartSize').value); + cartSize = cartSize - 1; + if (selectedItem > 0) { + jQuery('#selectedItem').val(selectedItem - 1); + updateCartItemSelected(jQuery('#selectedItem').value, 'Y'); + } + return false; +} + +function keyDown() { + var selectedItem = parseInt(jQuery('#selectedItem').value); + var cartSize = parseInt(jQuery('#cartSize').value); + cartSize = cartSize - 1; + if (selectedItem < cartSize) { + jQuery('#selectedItem').val(selectedItem + 1); + updateCartItemSelected(jQuery('#selectedItem').value, 'Y'); + } + return false; +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/EditAddress.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/EditAddress.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/EditAddress.js (revision 0) @@ -0,0 +1,100 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +var uiLabelJsonObjects = null; +jQuery(document).ready(function() { + jQuery('#editAddressCreateUpdate').bind('click', function(event) { + pleaseWait('Y'); + var param = 'partyId=' + jQuery('#partyId').val() + '&firstName=' + jQuery('#personFirstName').val() + '&lastName=' + jQuery('#personLastName').val() + + '&contactMechId=' + jQuery('#contactMechId').val() + '&contactMechPurposeTypeId=' + jQuery('#contactMechPurposeTypeId').val() + + '&address1=' + jQuery('#personAddress1').val() + '&address2=' + jQuery('#personAddress2').val() + + '&countryProvinceGeo=' + jQuery('#countryProvinceGeo').val() + '&stateProvinceGeo=' + jQuery('#stateProvinceGeo').val() + + '&city=' + jQuery('#personCity').val() + '&postalCode=' + jQuery('#personPostalCode').val(); + jQuery.ajax({url: 'CreateUpdateAddress', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfCreateUpdateAddress(data); + }, + error: function(data) { + getResultOfCreateUpdateAddress(data); + } + }); + productToSearchFocus(); + pleaseWait('N'); + partySearchAgain(); + return false; + }); + + jQuery('#editAddressCancel').bind('click', function(event) { + pleaseWait('Y'); + productToSearchFocus(); + pleaseWait('N'); + jQuery('#searchPartiesResults').show(); + return false; + }); + + var labelObject = { + "CommonUiLabels" : ["CommonCreate", "CommonUpdate"], + }; + + uiLabelJsonObjects = getJSONuiLabels(labelObject); +}); + +function getResultOfCreateUpdateAddress(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#editAddressFormServerError').html(serverError); + } else { + productToSearchFocus(); + } +} + +function editAddress(partyIdIn, contactMechIdIn, contactMechPurposeTypeIdIn) { + var param = 'partyId=' + partyIdIn + '&contactMechId=' + contactMechIdIn + '&contactMechPurposeTypeId=' + contactMechPurposeTypeIdIn; + jQuery.ajax({url: 'EditAddress', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfEditAddress(data); + } + }); + jQuery('#editAddress').show(); + jQuery('#personLastName').focus(); +} + +function getResultOfEditAddress(data) { + jQuery('#partyId').val(data.partyId); + jQuery('#contactMechId').val(data.contactMechId); + jQuery('#contactMechPurposeTypeId').val(data.contactMechPurposeTypeId); + jQuery('#personLastName').val(data.lastName); + jQuery('#personFirstName').val(data.firstName); + jQuery('#personAddress1').val(data.address1); + jQuery('#personAddress2').val(data.address2); + jQuery('#countryProvinceGeo').val(data.countryGeoId); + jQuery('#stateProvinceGeo').val(data.stateProvinceGeoId); + jQuery('#personCity').val(data.city); + jQuery('#personPostalCode').val(data.postalCode); + if (data.partyId != "") { + jQuery('#editAddressCreateUpdate').val(uiLabelJsonObjects.CommonUiLabels[1]); + } else { + jQuery('#editAddressCreateUpdate').val(uiLabelJsonObjects.CommonUiLabels[0]); + } +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/SearchParties.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/SearchParties.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/SearchParties.js (revision 0) @@ -0,0 +1,229 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +function partyKeyEvents() { + jQuery('#partyToSearch').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + partySearch(); + return false; + } + }); + + jQuery('#billingAddressSelected').bind('click', function(event) { + jQuery('#billingAddress').show(); + jQuery('#shippingAddress').hide(); + jQuery('#billingLocation').val("Y"); + jQuery('#shippingLocation').val("N"); + customerAddressSelected(); + return false; + }); + + jQuery('#shippingAddressSelected').bind('click', function(event) { + jQuery('#billingAddress').hide(); + jQuery('#shippingAddress').show(); + jQuery('#billingLocation').val("N"); + jQuery('#shippingLocation').val("Y"); + customerAddressSelected(); + return false; + }); + + jQuery('#searchPartyBy').bind('change', function(event) { + partyToSearchFocus(); + }); + + jQuery('#partySearchConfirm').bind('click', function(event) { + partySearch(); + return false; + }); +} + +function customerAddressSelected() { + if (jQuery('#billingLocation').val() == 'Y') { + jQuery("#billingAddressSelected").addClass("selectedAddress"); + jQuery("#shippingAddressSelected").removeClass("selectedAddress"); + jQuery('#shipMethodPanel').hide(); + jQuery('#billingPanel').show(); + } else { + jQuery("#billingAddressSelected").removeClass("selectedAddress"); + jQuery("#shippingAddressSelected").addClass("selectedAddress"); + if (jQuery('#shipToSelected').val() != undefined && jQuery('#shipToSelected').val() == 'Y') { + getShipMethods(); + } + } +} + +function getShipMethods() { + var result = false; + if (jQuery('#shipMethod').val() == "" || jQuery('#shipMethod').val() == null) { + jQuery.ajax({url: 'GetShipMethods', + type: 'post', + success: function(data) { + getResultOfGetShipMethods(data); + }, + error: function(data) { + getResultOfGetShipMethods(data); + } + }); + } + jQuery('#billingPanel').hide(); + jQuery('#shipMethodPanel').show(); + jQuery('#shipMethod').bind('change', function(event) { + setShipMethod(); + }); + return result; +} + +function getResultOfGetShipMethods(data) { + var result = false; + var shipOptions = null; + var optionList = ""; + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#shipMethodFormServerError').fadeIn('slow', function() { + jQuery('#shipMethodFormServerError').html(serverError); + }); + } else { + jQuery('#shipMethodFormServerError').fadeOut('slow'); + shipOptions = data.shippingOptions; + optionList = optionList + ""; + jQuery('#shipMethodSelection').html(optionList); + result = true; + } + return result; +} + +function setShipMethod() { + pleaseWait('Y'); + var result = false; + var shipTotal = null; + var shipMethod = null; + var param = 'shipMethod=' + jQuery('#shipMethod').val(); + jQuery('#shipMethodFormServerError').fadeOut('slow'); + jQuery.ajax({url: 'SetShipMethod', + data: param, + type: 'post', + async: false, + success: function(data) { + result = getResultOfSetShippingMethod(data); + }, + error: function(data) { + result = getResultOfSetShippingMethod(data); + } + }); + updateCart(); + pleaseWait('N'); + return result; +} + +function getResultOfSetShippingMethod(data) { + var result = false; + shipTotal = data.shippingTotal; + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#shippingOptionFormServerError').fadeIn('slow', function() { + jQuery('#shippingOptionFormServerError').html(serverError); + }); + isShipOptionStepValidate = false; + } else { + isShipOptionStepValidate = true; + jQuery('#selectedShipmentOption').html(data.shippingDescription); + result = true; + } + return result; +} + +function setParty(partyId, contactMechId, contactMechPurposeTypeId) { + pleaseWait('Y'); + var param = 'partyId=' + partyId + '&contactMechId=' + contactMechId + '&contactMechPurposeTypeId=' + contactMechPurposeTypeId; + jQuery.ajax({url: 'SetPartyToCart', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfSetParty(data); + }, + error: function(data) { + getResultOfSetParty(data); + } + }); + updateCustomerAddress(); + customerAddressSelected(); + hideOverlayDiv(); + pleaseWait('N'); +} + +function partyToSearchFocus() { + hideOverlayDiv(); + jQuery('#partyToSearch').focus(); + return false; +} + +function getResultOfSetParty(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + clearErrorMessages(); + jQuery('#partyToSearch').val(''); + updateCart(); + partyToSearchFocus(); + } +} + +function partySearch() { + pleaseWait('Y'); + var param = 'partyIdentificationTypeId=' + jQuery('#partyIdentificationTypeId').val() + + '&billingLocation=' + jQuery('#billingLocation').val() + + '&shippingLocation=' + jQuery('#shippingLocation').val(); + if (jQuery('#searchPartyBy').val() == "lastName") { + param = param + '&searchByPartyLastName=' + jQuery('#partyToSearch').val(); + } else if (jQuery('#searchPartyBy').val() == "firstName") { + param = param + '&searchByPartyFirstName=' + jQuery('#partyToSearch').val(); + } else if (jQuery('#searchPartyBy').val() == "idValue") { + param = param + '&searchByPartyIdValue=' + jQuery('#partyToSearch').val(); + } + jQuery.ajax({url: 'FindParties', + data: param, + type: 'post', + async: false, + success: function(data) { + var parties = data.partiesList; + // automatically add party to cart if returned only one party + if (parties.length == 1) { + setParty(parties[0].partyId, parties[0].contactMechId, parties[0].contactMechPurposeTypeId); + } else { + buildPartiesResults(parties, 'Y'); + } + }, + error: function(data) { + alert("Error during party searching"); + } + }); + pleaseWait('N'); +} \ No newline at end of file Property changes on: specialpurpose/webpos/webapp/webpos/images/js/SearchParties.js ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Date Rev Author URL Id Added: svn:eol-style + native Index: specialpurpose/webpos/webapp/webpos/images/js/PayGiftCard.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/PayGiftCard.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/PayGiftCard.js (revision 0) @@ -0,0 +1,130 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +jQuery(document).ready(function() { + jQuery('#removeGiftCardTotalPaid').bind('click', function(event) { + pleaseWait('Y'); + var param = 'clearCash=N&clearCheck=N&clearGift=Y&clearCredit=N'; + jQuery.ajax({url: 'ClearPayment', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfCashClearPayment(data); + }, + error: function(data) { + getResultOfCashClearPayment(data); + } + }); + pleaseWait('N'); + productToSearchFocus(); + return false; + }); + + jQuery('#amountGiftCard').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payGiftCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#refNumGiftCard').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + payGiftCardConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#payGiftCardConfirm').bind('click', function(event) { + payGiftCardConfirm(); + return false; + }); + + jQuery('#payGiftCardCancel').bind('click', function(event) { + productToSearchFocus(); + return false; + }); +}); + +function payGiftCardConfirm() { + pleaseWait('Y'); + var param = 'amountGiftCard=' + jQuery('#amountGiftCard').val() + '&refNum=' + jQuery('#refNumGiftCard').val(); + jQuery.ajax({url: 'PayGiftCard', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfPayGiftCard(data); + }, + error: function(data) { + getResultOfPayGiftCard(data); + } + }); + pleaseWait('N'); +} + +function payGiftCard(cleanErrors) { + if (cleanErrors == undefined) { + cleanErrors = "Y"; + } + if (cleanErrors == "Y") { + hideOverlayDiv(); + jQuery('#payGiftCardFormServerError').html(""); + jQuery('#amountGiftCard').val(""); + jQuery('#refNumGiftCard').val(""); + } + jQuery('#giftCardTotalDue').html(jQuery('#totalDueFormatted').val()); + jQuery('#giftCardTotalPaid').html(jQuery('#totalGiftFormatted').val()); + jQuery('#payGiftCard').show(); + jQuery('#amountGiftCard').focus(); + return false; +} + +function getResultOfPayGiftCard(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#payGiftCardFormServerError').html(serverError); + payGiftCard('N'); + } else { + clearErrorMessages(); + updateCart(); + productToSearchFocus(); + } +} + +function getResultOfGiftCardClearPayment(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#errors').fadeIn('slow', function() { + jQuery('#errors').html(serverError); + }); + } else { + clearErrorMessages(); + updateCart(); + } +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/OpenTerminal.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/OpenTerminal.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/OpenTerminal.js (revision 0) @@ -0,0 +1,83 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +jQuery(document).ready(function() { + jQuery('#startingDrawerAmount').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + openTerminalConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#openTerminalConfirm').bind('click', function(event) { + openTerminalConfirm(); + return false; + }); + + jQuery('#openTerminalCancel').bind('click', function(event) { + productToSearchFocus(); + return false; + }); +}); + +function openTerminalConfirm() { + pleaseWait('Y'); + var param = 'startingDrawerAmount=' + jQuery('#startingDrawerAmount').val(); + jQuery.ajax({url: 'OpenTerminal', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfOpenTerminal(data); + }, + error: function(data) { + getResultOfOpenTerminal(data); + } + }); + pleaseWait('N'); +} + +function openTerminal(cleanErrors) { + if (cleanErrors == undefined) { + cleanErrors = "Y"; + } + if (cleanErrors == "Y") { + hideOverlayDiv(); + jQuery('#openTerminalFormServerError').html(""); + jQuery('#startingDrawerAmount').val(""); + } + jQuery('#startingDrawerAmount').focus(); + jQuery('#openTerminal').show(); +} + +function getResultOfOpenTerminal(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#openTerminalFormServerError').html(serverError); + openTerminal('N'); + } else { + clearErrorMessages(); + updateCart(); + productToSearchFocus(); + } +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/VoidOrder.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/VoidOrder.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/VoidOrder.js (revision 0) @@ -0,0 +1,83 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +jQuery(document).ready(function() { + jQuery('#orderId').bind('keypress', function(event) { + code = event.keyCode ? event.keyCode : event.which; + if (code.toString() == 13) { + voidOrderConfirm(); + return false; + } + if (code.toString() == 27) { + productToSearchFocus(); + return false; + } + }); + + jQuery('#voidOrderConfirm').bind('click', function(event) { + voidOrderConfirm(); + return false; + }); + + jQuery('#voidOrderCancel').bind('click', function(event) { + productToSearchFocus(); + return false; + }); +}); + +function voidOrderConfirm() { + pleaseWait('Y'); + var param = 'orderId=' + jQuery('#orderId').val(); + jQuery.ajax({url: 'VoidOrder', + data: param, + type: 'post', + async: false, + success: function(data) { + getResultOfVoidOrder(data); + }, + error: function(data) { + getResultOfVoidOrder(data); + } + }); + pleaseWait('N'); +} + +function voidOrder(cleanErrors) { + if (cleanErrors == undefined) { + cleanErrors = "Y"; + } + if (cleanErrors == "Y") { + hideOverlayDiv(); + jQuery('#voidOrderFormServerError').html(""); + jQuery('#orderId').val(""); + } + jQuery('#voidOrder').show(); + jQuery('#orderId').focus(); +} + +function getResultOfVoidOrder(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery('#voidOrderFormServerError').html(serverError); + voidOrder('N'); + } else { + clearErrorMessages(); + updateCart(); + productToSearchFocus(); + } +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/Shortcuts.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/Shortcuts.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/Shortcuts.js (revision 0) @@ -0,0 +1,55 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ +function updateHotKeys() { + var item = 0; + var shortcutList = ""; + jQuery.each(WebPosHotkeys.hotkeys, function(i, arr) { + shortcutList = shortcutList + '
  1. '; + shortcutList = shortcutList + ''; + shortcutList = shortcutList + arr[1].toUpperCase() + '
    '; + shortcutList = shortcutList + arr[4] + '
  2. '; + item = item + 1; + }); + jQuery('#posShortcut').html(shortcutList); + showSelectedShortcut(); +} + +function executeAction(item) { + hideOverlayDiv(); + var key = WebPosHotkeys.hotkeys[item]; + var action = key[3]; + eval(action); +} + +function showSelectedShortcut() { + jQuery('li.notSelectedShortcut').each(function(idx) { + var id = jQuery(this).attr('id'); + if (id != '') { + id = '#' + id; + jQuery(id).mouseover(function(event) { + jQuery(id).addClass("selectedShortcut"); + jQuery(id).removeClass("notSelectedShortcut"); + }); + jQuery(id).mouseout(function(event) { + jQuery(id).addClass("notSelectedShortcut"); + jQuery(id).removeClass("selectedShortcut"); + }); + } + }); +} \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/images/js/jquery.hotkeys-0.7.9.min.js =================================================================== --- specialpurpose/webpos/webapp/webpos/images/js/jquery.hotkeys-0.7.9.min.js (revision 0) +++ specialpurpose/webpos/webapp/webpos/images/js/jquery.hotkeys-0.7.9.min.js (revision 0) @@ -0,0 +1,19 @@ +(function(jQuery){jQuery.fn.__bind__=jQuery.fn.bind;jQuery.fn.__unbind__=jQuery.fn.unbind;jQuery.fn.__find__=jQuery.fn.find;var hotkeys={version:'0.7.9',override:/keypress|keydown|keyup/g,triggersMap:{},specialKeys:{27:'esc',9:'tab',32:'space',13:'return',8:'backspace',145:'scroll',20:'capslock',144:'numlock',19:'pause',45:'insert',36:'home',46:'del',35:'end',33:'pageup',34:'pagedown',37:'left',38:'up',39:'right',40:'down',109:'-',112:'f1',113:'f2',114:'f3',115:'f4',116:'f5',117:'f6',118:'f7',119:'f8',120:'f9',121:'f10',122:'f11',123:'f12',191:'/'},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":":","'":"\"",",":"<",".":">","/":"?","\\":"|"},newTrigger:function(type,combi,callback){var result={};result[type]={};result[type][combi]={cb:callback,disableInInput:false};return result;}};hotkeys.specialKeys=jQuery.extend(hotkeys.specialKeys,{96:'0',97:'1',98:'2',99:'3',100:'4',101:'5',102:'6',103:'7',104:'8',105:'9',106:'*',107:'+',109:'-',110:'.',111:'/'});jQuery.fn.find=function(selector){this.query=selector;return jQuery.fn.__find__.apply(this,arguments);};jQuery.fn.unbind=function(type,combi,fn){if(jQuery.isFunction(combi)){fn=combi;combi=null;} +if(combi&&typeof combi==='string'){var selectorId=((this.prevObject&&this.prevObject.query)||(this[0].id&&this[0].id)||this[0]).toString();var hkTypes=type.split(' ');for(var x=0;x + \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/search/SearchParties.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/search/SearchParties.ftl (revision 0) +++ specialpurpose/webpos/webapp/webpos/search/SearchParties.ftl (revision 0) @@ -0,0 +1,34 @@ +<#-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +
    + + + +
    + + +
    +
    + \ No newline at end of file Property changes on: specialpurpose/webpos/webapp/webpos/search/SearchParties.ftl ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Date Rev Author URL Id Added: svn:eol-style + native Index: specialpurpose/webpos/webapp/webpos/search/SearchPartiesResults.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/search/SearchPartiesResults.ftl (revision 0) +++ specialpurpose/webpos/webapp/webpos/search/SearchPartiesResults.ftl (revision 0) @@ -0,0 +1,86 @@ +<#-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/search/CustomerAddress.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/search/CustomerAddress.ftl (revision 0) +++ specialpurpose/webpos/webapp/webpos/search/CustomerAddress.ftl (revision 0) @@ -0,0 +1,121 @@ +<#-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +
    + +
    +
    +
    + + +
    + + <#if billingPostalAddress?exists> + <#if personBillTo?exists> + + + + + <#assign state = billingPostalAddress.getRelatedOne("StateProvinceGeo")?if_exists/> + <#assign country = billingPostalAddress.getRelatedOne("CountryGeo")?if_exists/> + + + + + + + + + + <#else> + + + + + + + +
    <#if personBillTo.lastName?has_content>${personBillTo.lastName} <#if personBillTo.firstName?has_content>${personBillTo.firstName}
    <#if billingPostalAddress.address1?has_content>${billingPostalAddress.address1}
    <#if billingPostalAddress.city?has_content>${billingPostalAddress.city}, <#if state?exists && state?has_content && state.geoCode?has_content>${state.geoCode} <#if billingPostalAddress.postalCode?has_content>${billingPostalAddress.postalCode} +
    <#if country?exists && country?has_content &&country.get("geoName", locale)?has_content>${country.get("geoName", locale)} +
     
    ${uiLabelMap.WebPosNoPartyInformation}
    +
    + +
    +
    + ${screens.render("component://webpos/widget/SearchScreens.xml#Parties")} +
    +
     
    +
    +  
    +
    +
    + +
    +
    +
    +
    + \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/search/SearchSalesReps.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/search/SearchSalesReps.ftl (revision 0) +++ specialpurpose/webpos/webapp/webpos/search/SearchSalesReps.ftl (revision 0) @@ -0,0 +1,60 @@ +<#-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +
    +
    + <#if salesReps?exists && salesReps?has_content> + + <#assign alt_row = false> + <#list salesReps as salesRep> + <#assign salesRepInCart = false> + <#if cartSalesReps?exists && cartSalesReps?has_content> + <#list cartSalesReps as cartSalesRep> + <#if cartSalesRep == salesRep.partyId> + <#assign salesRepInCart = true> + + + + <#assign person = ""/> + <#if salesRep.lastName?has_content> + <#assign person = person + (salesRep.lastName).trim() + " "/> + + <#if salesRep.firstName?has_content> + <#assign person = person + (salesRep.firstName).trim()/> + + <#assign person = person + " (" + salesRep.partyId + ")"/> + class="pos-cart-choose"<#else><#if alt_row>class="pos-cart-even"<#else>class="pos-cart-odd"> + + + <#-- toggle the row color --> + <#assign alt_row = !alt_row> + +
    + <#if salesRepInCart> + +  ${person} + + <#else> + +  ${person} + + +
    + +
    +
    \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/search/SearchProducts.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/search/SearchProducts.ftl (revision 1096554) +++ specialpurpose/webpos/webapp/webpos/search/SearchProducts.ftl (working copy) @@ -16,26 +16,24 @@ specific language governing permissions and limitations under the License. --> -
    -
    - - - - - - -
    - - - - -
    +
    + + + + + + + +
    + +

    \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/includes/Footer.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/includes/Footer.ftl (revision 1096554) +++ specialpurpose/webpos/webapp/webpos/includes/Footer.ftl (working copy) @@ -1,34 +0,0 @@ -<#-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> - -<#assign nowTimestamp = Static["org.ofbiz.base.util.UtilDateTime"].nowTimestamp()> - -
    -
    - Valid CSS! - Valid XHTML 1.0! -
    -
    -
    -
    Copyright (c) 2001-${nowTimestamp?string("yyyy")} The Apache Software Foundation - www.apache.org
    -
    Powered by Apache OFBiz
    -
    -
    - - Index: specialpurpose/webpos/webapp/webpos/includes/Language.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/includes/Language.ftl (revision 1096554) +++ specialpurpose/webpos/webapp/webpos/includes/Language.ftl (working copy) @@ -1,39 +0,0 @@ -<#-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> - -
    -
    -

    ${uiLabelMap.CommonLanguageTitle}

    -
    -
    -
    - -
    -
    -
    \ No newline at end of file Index: specialpurpose/webpos/webapp/webpos/includes/Messages.ftl =================================================================== --- specialpurpose/webpos/webapp/webpos/includes/Messages.ftl (revision 1096554) +++ specialpurpose/webpos/webapp/webpos/includes/Messages.ftl (working copy) @@ -62,3 +62,5 @@ + +